Replication Archive for "All Keynesian Now?" paper
===================================================

This is the readme file for the replication archive. The archive itself provides all data and code that are necessary to fully replicate the results presented both in the main text and the supplementary material.


Folder Structure
----------------

The archive makes use of folder hierarchies to divided various files into different types. The original container folder for this hierarchy is called "UKKeynesiansReplication", but this need not be the name of the folder - assuming that the relevant "setwd()" and "global basedir" commands are correctly adjusted for each of scripts/eurobarometer.r and exp1.do. The structure of the folder/file hierarchy is as follows:

[UKKeynesiansReplication]
 - generated_data
   - eb_uk.rdata
 - generated_images
   - [Various .pdf files]
 - generated_tex
   - [Various .tex files]
 - scripts
   - balanceplot.do
   - eurobarometer_setup.r
   - eurobarometer.r
   - exp1.do
   - exp2.do
 - source_data
   - eurobarometer
      - [Assorted Eurobarometer folders, by survey number]
   - exp1_BarnesHicks_EPPGB_Survey_SignOff.doc
   - exp1_CODEBOOK.pdf
   - exp1_UniversityCollegeLondonresults_160318_Economy.csv
   - exp1_UniversityCollegeLondonresults_160318_Economy.dta
   - exp2_BarnesHicks_FiscalSurvey_201606.doc
   - exp2_CODEBOOK.xls
   - exp2_UCLResults_160704_Economy.csv
 - UKKeynesiansReplication.zip


The folder hierarchy allows us to separate source data from "generated" (i.e. processed) data. It also allows us to separate out the image and latex files that are generated from our analysis scripts (and subsequently automatically embedded in our manuscript [not included in this archive]). The principle is that files in folders starting with "generated_" can be deleted as they are all created by running various scripts in the "scripts" folder. (For this distribution of the replication archive, that is not strictly true as the "source_data" folder is *not* fully populated with the source Eurobarometer survey data, and so the archive (as distributed) is strictly dependent on the existence of generated_data/eb_uk.rdata.)

The "assorted Eurobarometer folders" indicate where source Eurobarometer data files should be placed if an analyst wishes to replicate the Eurobarometer analysis *fully* from source. As we do not wish to distribute the source Eurobarometer files here, ourselves - the data do not belong to us - we have excluded these files and instead indicated which files should be obtained and how they should be placed and named in the folder hierarchy in order to work with the scripts/eurobarometer_setup.r script. The filename convention expected by scripts/eurobarometer_setup.r is that the Stata-format source data for, say, Eurobaromater survey 73.4 should be downloaded, renamed to "73.4.dta", and placed at "source_data/eurobarometer/73.4/73.4.dta". And likewise for all the other surveys.

The replication archive still works for the Eurobarometer analysis as we *have* included the processed Eurobarometer data (i.e. a small subset of the data from the original surveys, and merged into one data.frame).

Finally, UKKeynesiansReplication.zip is a zipped archive of all of the other files and structures. It can be downloaded and unzipped to quickly get a version of our replication archive that is laid out exactly as we have it on our own file systems. In our experience, this is a much easier way of approaching the replication process, as compared to the options offered by the Dataverse system, in which folder hierarchies are lost and data files are auto-converted to multiple formats, making it unclear which are the core data files that the original analysts actually used.


How To Replicate the Analyses
-----------------------------

There are two parts to the analysis in the paper.

The first part analyzes data collected from two survey experiments that we conducted. To replicate these analyses, you should run the scripts/exp1.do and then the scripts/exp2.do scripts. The first of these performs analyses on the data from the first experiment and outputs results to generated_tex and generated_images, as well as saving out the processed data from the first experiment to generated_data/exp1.dta. The second script likewise analyzes the data from the second experiment, and then merges in the data from the first to produce the analyses on the combined sample. Again, all results and figures are outputted to the relevant generated_* folders.

The second part of the data analysis makes use of Eurobarometer data. The analysis for these data can be replicated by running eurobarometer.r. Before running it, you should change the first line of code so that it sets the working directory to be the "scripts" folder in the replication archive.

(N.b. it is not necessary to run eurobarometer_setup.r if you do not wish to source all of the Eurobarometer survey data files, yourself.)


Comparing Replicated Outputs With Our Outputs
---------------------------------------------

The replication archive includes the fully populated generated_images and generated_tex folders - i.e. they contain all of the files that are created by running each of scripts/exp1.do, scripts/exp2.do, and scripts/eurobarometer.r. They constitute the log of results that we should be replicated against. The are also the same files that are sourced into the latex document in which we wrote the manuscripts.

N.b. running the various analysis scripts will automatically over-write the contents of generated_tex and generated_images (and generated_data/exp1.dta). Consequently, someone wishing to directly replicate the analysis should copy the contents of those *.pdf and *.tex files to another folder, run the analysis scripts, and then compare the results of this new run and the copies of the original/distributed files. They should be identical.
